import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
public class TCSyslog {
	public int logOpen = 0;
	public String msgLogDir = null;
	public String errLogDir = null;
	public String msgLogPach = null;
	public String errLogPach = null;
	public TCSyslog(){
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyHHdd");
		String nowDate = sdf.format(date);
		logOpen = 0;
		msgLogDir = "C:\\";
		errLogDir = "C:\\";
		msgLogPach = msgLogDir+"message"+nowDate;
		errLogPach = errLogDir+"ErrMsg"+nowDate;
		File fileMsg = new File(msgLogPach);
		if(!fileMsg.exists()){
			File file = new File(msgLogDir);
			try {
				fileMsg.createTempFile("message","log",file);
			} catch (IOException e) {
				e.printStackTrace();
			}
		};
		File fileErr = new File(errLogPach);
		if(!fileErr.exists()){
			File file = new File(errLogDir);
			try {
				fileMsg.createTempFile("ErrorMsg","log",file);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	public void TCMsg(String msg){
		try{
			File file = new File(msgLogPach);
			FileWriter fw = new FileWriter(file);
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(msg);
			bw.flush();
			bw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
	}
	public void TCErrMsg(String msg){
		
		
	}
}
